using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestPoolElement : BasePoolElement
{

    Vector3 dir;
    float time;
    float lifeTime;
    public override void PoolInit()
    {
        transform.position = Vector3.zero;
        time = 0;
        lifeTime = UnityEngine.Random.Range(3, 6);
        dir = UnityEngine.Random.insideUnitSphere;
        dir.y = 0;
    }


    private void FixedUpdate()
    {
        time += Time.fixedDeltaTime;
        if (time > lifeTime)
        {
            ObjectPoolManager.Instance.EnPool(this);
        }
        transform.position += dir * Time.deltaTime;
    }
}